<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:if test="${not empty resultList}">
	<ul>
		<c:forEach items="${resultList}" var="item">
			<li>
                <div class="host_article">
                  <h1 class="title" title="${item.name }"><c:choose><c:when test="${fn:length(item.name) > 14}">${fn:substring(item.name,0,14)}...</c:when><c:otherwise>${item.name }</c:otherwise></c:choose></h1>
                  <div class="suggest"> <a target="_blank" href="mall/product/view/${item.id }"><img src="ipiimg/hspg.png" border="0" /></a>
                  <p>套餐内容：${item.name }<br/></p>
	           	  <h2>￥<fmt:formatNumber value="${item.price / 100.0}" pattern="#0.00" />元</h2>
	           	  <c:choose>
	           	  	<c:when test="${sessionScope.user.userRole eq 'admin'}">
	           	  		<p class="mt5"><a target="_blank" href="productManager_toModify.action?productId=${item.id }"><input type="button" class="btnc_a" value="修改套餐"/></a></p>
                 		<p class="mt5"><input type="button" class="btnc_a" value="下架套餐" onclick="toDown(${item.id },'${item.name }')" /></p>
	           	  	</c:when>
	           	  	<c:otherwise>
	           	  		<p class="mt5"><input type="button" class="btnc_a" value="加入购物车" onclick="addOrderItem(${item.id })" /></p>
                 		<p class="mt5"><input type="button" class="btnc_a" value="我要购买" onclick="buy(${item.id })" /></p>
	           	  	</c:otherwise>
	           	  </c:choose>
                  
                  </div>
                  <div class="explain" title="${item.remark }"><c:choose><c:when test="${fn:length(item.remark) > 34}">${fn:substring(item.remark,0,34)}...</c:when><c:otherwise>${item.remark }</c:otherwise></c:choose></div>
                </div>
			</li>
		</c:forEach>
	</ul>
</c:if>